void show_stack_overflow(unsigned long esp)
{
#ifdef MEMORY_GUARD
- unsigned long esp_top = get_stack_bottom() & PAGE_MASK;
+ unsigned long esp_top;
unsigned long *stack, addr;
- /* Trigger overflow trace if %esp is within 100 bytes of the guard page. */
- if ( ((esp - esp_top) > 100) && ((esp_top - esp) > 100) )
+ esp_top = (esp | (STACK_SIZE - 1)) - DEBUG_STACK_SIZE;
+
+ /* Trigger overflow trace if %esp is within 512 bytes of the guard page. */
+ if ( ((unsigned long)(esp - esp_top) > 512) &&
+ ((unsigned long)(esp_top - esp) > 512) )
return;
if ( esp < esp_top )
{
struct tss_struct *tss = &doublefault_tss;
unsigned int cpu = ((tss->back_link>>3)-__FIRST_TSS_ENTRY)>>1;
+ char taint_str[TAINT_STRING_MAX_LEN];
watchdog_disable();
/* Find information saved during fault and dump it to the console. */
tss = &init_tss[cpu];
+ printk("*** DOUBLE FAULT: Xen-%d.%d%s %s\n",
+ XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+ print_tainted(taint_str));
printk("CPU: %d\nEIP: %04x:[<%08x>]",
cpu, tss->cs, tss->eip);
print_symbol(" %s\n", tss->eip);
asmlinkage void double_fault(void);
asmlinkage void do_double_fault(struct cpu_user_regs *regs)
{
+ unsigned int cpu, tr;
+ char taint_str[TAINT_STRING_MAX_LEN];
+
+ asm ( "str %0" : "=r" (tr) );
+ cpu = ((tr >> 3) - __FIRST_TSS_ENTRY) >> 2;
+
watchdog_disable();
console_force_unlock();
/* Find information saved during fault and dump it to the console. */
- printk("************************************\n");
- show_registers(regs);
+ printk("*** DOUBLE FAULT: Xen-%d.%d%s %s\n",
+ XEN_VERSION, XEN_SUBVERSION, XEN_EXTRAVERSION,
+ print_tainted(taint_str));
+ printk("CPU: %d\nRIP: %04x:[<%016lx>]",
+ cpu, regs->cs, regs->rip);
+ print_symbol(" %s", regs->rip);
+ printk("\nRFLAGS: %016lx\n", regs->rflags);
+ printk("rax: %016lx rbx: %016lx rcx: %016lx\n",
+ regs->rax, regs->rbx, regs->rcx);
+ printk("rdx: %016lx rsi: %016lx rdi: %016lx\n",
+ regs->rdx, regs->rsi, regs->rdi);
+ printk("rbp: %016lx rsp: %016lx r8: %016lx\n",
+ regs->rbp, regs->rsp, regs->r8);
+ printk("r9: %016lx r10: %016lx r11: %016lx\n",
+ regs->r9, regs->r10, regs->r11);
+ printk("r12: %016lx r13: %016lx r14: %016lx\n",
+ regs->r12, regs->r13, regs->r14);
+ printk("r15: %016lx\n", regs->r15);
show_stack_overflow(regs->rsp);
printk("************************************\n");
- printk("CPU%d DOUBLE FAULT -- system shutdown\n", smp_processor_id());
+ printk("CPU%d DOUBLE FAULT -- system shutdown\n", cpu);
printk("System needs manual reset.\n");
printk("************************************\n");